package org.example.spring.self.demo.aspect;


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class MyAspect {

	@Before("execution(public void org.example.spring.self.demo.service.UserService.test())")
	public void myBefore(JoinPoint joinPoint) {
		// 当前普通对象
		joinPoint.getTarget();
		// 当前代理对象
		joinPoint.getThis();
		System.out.println("myBefore()");
	}
}
